package com.itheima.网络编程.网络三要素;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class IpAddress {
    public static void main(String[] args) throws UnknownHostException {
        InetAddress byName = InetAddress.getByName("192.168.18.1");
        System.out.println(byName.getHostAddress());
        System.out.println(byName.getHostName());
    }
}
